1. Field of the Invention
The present invention relates to a computer apparatus being suitable for use in a printer apparatus and having an electrically rewritable nonvolatile memory for writing an operation program thereto, and a nonvolatile semiconductor memory being suitable for use in the computer apparatus.
2. Description of the Related Art
Conventionally, in a microcomputer apparatus, to perform the processing of the entire apparatus, a program previously stored in a normal read only memory (hereinafter, abbreviated to as ROM) is executed by a central processing unit (hereinafter, abbreviated to as CPU). In recent years, as the ROM, a flash ROM which is a type of an electrically rewritable nonvolatile memory has widely been used in printer apparatuses and electronic cash registers. The use of an electrically erasable programmable ROM (EEPROM) such as the flash ROM instead of the normal ROM makes it unnecessary to hardware-replace the ROM chip when it is necessary to correct a bug of the stored program. This is because the contents in the EEPROM can easily be software-corrected with the EEPROM being mounted on the microcomputer apparatus. In erasing the contents in the EEPROM and writing data to the EEPROM, however, an operation is necessary which is different from the mere readout of the contents in the memory. Since the flash ROM has both the ease-of-use of the EEPROM and the cost effectiveness of an erasable programmable ROM (EPROM) which can be formed of a transistor having a single memory cell, the range of use of the flash ROM has been increasing.
In the microcomputer apparatus, a program which enables rewriting of the flash ROM is stored as an initial program loader (hereinafter, abbreviated as IPL) of the apparatus. When the IPL is erased due to an external factor such as static electricity, an IC card or a memory board storing the IPL therein is externally connected to the apparatus and the IPL is temporarily stored in a readable and writable memory such as a random access memory (hereinafter, abbreviated as RAM) in the apparatus. By using the IPL, the IPL of the microcomputer apparatus is recovered and it is checked whether the apparatus has trouble or not.
As the prior art, an arrangement is known such that a static RAM card is externally connected to the microcomputer apparatus and after flash ROM rewriting data stored in the static RAM card is temporarily transferred to the RAM in the microcomputer apparatus, erasing of the flash ROM, data writing and collation are performed. An example of the prior art is disclosed in Japanese Laid-open Patent Application H6-139064. In this example, a control program for controlling the operation of electronic apparatuses is stored in the flash ROM and the IPL program is stored in the normal ROM. The IPL program includes a system booting program which operates at power-on, and a flash ROM rewriting program.
When a bug, i.e. a faulty portion is found in the control program stored in the flash ROM, in order to rewrite the control program, a static RAM card storing a debugged control program therein is attached to a memory card connector provided on the body of the electronic apparatus. When the static RAM card is attached, the system booting program included in the IPL program in the ROM determines that the static RAM card has control program data for rewriting the flash ROM, so that control is transferred to the control program included in the IPL program in the ROM. Then, based on the flash ROM rewriting program, the debugged control program is read from the static RAM card and stored in the internal RAM. When power for rewriting data is supplied to the flash ROM, the control program stored in the flash ROM is erased and the debugged control program stored in the internal RAM is written into the flash ROM.
Moreover, an apparatus has been proposed where instead of providing a ROM used specifically for storing the IPL program therein, the IPL program is stored in a rewritable nonvolatile semiconductor memory or in a flash ROM. The IPL program includes a rewriting program for changing an application program. By transferring the rewriting program to the RAM and executing the program at the RAM, the contents in the flash ROM are changed.
In an apparatus where an application program and the IPL program are stored in an electrically rewritable memory such as the flash ROM or the rewritable nonvolatile semiconductor memory, the contents in the flash ROM unintentionally can be rewritten due to an external factor such as static electricity or noise. When abnormality occurs in the application program, the application program can be rewritten into the ROM by executing the IPL program. However, when abnormality occurs in the IPL program, it is impossible to write the normal program into the apparatus.
For example, a computer apparatus disclosed in Japanese Laid-open Patent Application H5-342094 uses a technology which solves this problem. The computer apparatus comprises an electrically rewritable ROM storing an application program and the IPL program therein and means for deterring the output of a chip select signal for selecting a ROM when the apparatus is reset.
When abnormality occurs in the IPL program of the computer apparatus, a memory card storing the normal IPL program therein is connected to the computer apparatus. By resetting the computer apparatus after the memory card is connected, the memory card is selected by an output from the deterring means, so that the normal memory content changing program is executed from the IPL program stored in the memory card. By the memory content changing program, the application program and the IPL program are written into the ROM of the computer apparatus.
For the prior art using an IC card such as the static RAM card, an interface unit used specifically for the IC card and a connector for connecting the IC card are necessarily provided in the microcomputer apparatus. When the memory board is used, space is necessary for mounting the memory board and a connector is necessary for connecting the memory board. This increases the structure of the microcomputer apparatus and increases the cost. In addition, since erasing of the flash memory, writing and collation are performed after the rewriting program is transferred to the RAM, a long time is required.
For the prior art, an IC card or a memory board is necessary which has a data bus width the same as the data bas width of the microcomputer apparatus. That is, when the data bus width of the microcomputer apparatus is 16 bits, a 16-bit IC card or memory board, or two 8-bit IC cards or memory boards are necessary. This increases the cost of the microcomputer apparatus.
In an electronic apparatus according to the prior art of Japanese Laid-open Patent Application H6-139064, a ROM is provided which is used specifically for storing the memory content changing program therein, so that the number of parts of the electronic apparatus increases to increase the cost of the parts. Another method is to connect to the apparatus a memory board storing the memory content changing program therein to rewrite the memory content changing program. For this method, however, space for mounting the board and a connector for connecting the board are necessary.